<?php
require('config.php');

        $goods_id=$_REQUEST['goods_id'];
        $type=0;
        if(isset($_REQUEST['type'])) $type=$_REQUEST['type'];
		$sql="select goodsImg from `".$oto."_goods_gallerys` where `goodsId`='".$goods_id."'";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$person_info[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(!isset($person_info))
		{
			//$sql="select goodsImg from `".$oto."_integral` where `goodsId`='".$goods_id."'";
			if($type==1 || $type=='1') $sql="select goodsImg from `".$oto."_integral` where `goodsId`='".$goods_id."'";
			else $sql="select goodsImg from `".$oto."_goods` where `goodsId`='".$goods_id."'";
			$result=$db->query($sql);
			while($row=$result->fetch_assoc()){
				$person_info[]=$row;//将取得的所有数据赋值给person_info数组
			}
		}
		echo json_encode($person_info);
?>